package com.glsc.ngateway.common.api.flowable.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 流程抄送表
 * @author Lium
 */
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@Inheritance(strategy = InheritanceType.JOINED)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class FlowableCopyDto implements Serializable {

    private static final long serialVersionUID = -6692768540761032936L;

    @ApiModelProperty(value = "唯一编号")
    private Integer id;

    @ApiModelProperty(value = "第三方系统编号")
    private String sysid;

    @ApiModelProperty(value = "流程实例id")
    private String processInstanceId;

    @ApiModelProperty(value = "流程定义key")
    private String processDefinitionKey;

    @ApiModelProperty(value = "转办人名称")
    private String usernameSource;

    @ApiModelProperty(value = "转办人名称中文")
    private String usernameSourceChinese;

    @ApiModelProperty(value = "被转办人名称中文")
    private String usernameDestinationChinese;

    @ApiModelProperty(value = "被转办人名称")
    private String usernameDestination;

    @ApiModelProperty(value = "状态0未查看1已查看")
    private String status;

    @ApiModelProperty(value = "操作时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime opTime;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "流程创建人")
    private String startUser;

    @ApiModelProperty(value = "流程创建人姓名")
    private String startUserName;

    @ApiModelProperty(value = "抄送时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime startTime;

    @ApiModelProperty(value = "已读时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime readTime;

    @ApiModelProperty(value = "备注")
    private String remark;
}
